package com.blensmile.activity;

import android.os.Bundle;
import android.os.Handler;
import android.os.PersistableBundle;
import android.view.View;
import android.view.animation.AnimationUtils;
import android.widget.TextView;

import com.blensmile.BaseActivity;
import com.blensmile.R;
import com.blensmile.utils.LogUtils;
import com.blensmile.utils.SysUtils;
import com.blensmile.view.ShakeTip;

import org.w3c.dom.Text;

/**
 * Created by Blensmile on 2017/2/7.
 */
public class ExpandableList extends BaseActivity implements View.OnClickListener {
    Handler handler = new Handler();
    private TextView tvName;
    private ShakeTip tip;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_expandable_list);
        tvName = (TextView)findViewById(R.id.tv_name);
        tvName.setOnClickListener(this);
        tip = new ShakeTip(this,"hello world");
        LogUtils.b(SysUtils.getDeviceId());
    }


    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.tv_name:
                if(tip.isShowing()){
                    tip.dismiss();
                }else {
                    tip.showAsDropDown(tvName);
                    handler.postDelayed(new Runnable() {
                        @Override
                        public void run() {
                            tip.dismiss();
                        }
                    },900);
                }
        }
    }
}
